3.125 \(\int x^m \cos ^2(a+b \log (c x^n)) \, dx\)

Optimal. Leaf size=120 \[ \frac {(m+1) x^{m+1} \cos ^2\left (a+b \log \left (c x^n\right )\right )}{4 b^2 n^2+(m+1)^2}+\frac {2 b n x^{m+1} \sin \left (a+b \log \left (c x^n\right )\right ) \cos \left (a+b \log \left (c x^n\right )\right )}{4 b^2 n^2+(m+1)^2}+\frac {2 b^2 n^2 x^{m+1}}{(m+1) \left (4 b^2 n^2+(m+1)^2\right )} \]

[Out]

2*b^2*n^2*x^(1+m)/(1+m)/((1+m)^2+4*b^2*n^2)+(1+m)*x^(1+m)*cos(a+b*ln(c*x^n))^2/((1+m)^2+4*b^2*n^2)+2*b*n*x^(1+
m)*cos(a+b*ln(c*x^n))*sin(a+b*ln(c*x^n))/((1+m)^2+4*b^2*n^2)

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 120, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {4488, 30} \[ \frac {(m+1) x^{m+1} \cos ^2\left (a+b \log \left (c x^n\right )\right )}{4 b^2 n^2+(m+1)^2}+\frac {2 b n x^{m+1} \sin \left (a+b \log \left (c x^n\right )\right ) \cos \left (a+b \log \left (c x^n\right )\right )}{4 b^2 n^2+(m+1)^2}+\frac {2 b^2 n^2 x^{m+1}}{(m+1) \left (4 b^2 n^2+(m+1)^2\right )} \]

Antiderivative was successfully verified.

[In]

Int[x^m*Cos[a + b*Log[c*x^n]]^2,x]

[Out]

(2*b^2*n^2*x^(1 + m))/((1 + m)*((1 + m)^2 + 4*b^2*n^2)) + ((1 + m)*x^(1 + m)*Cos[a + b*Log[c*x^n]]^2)/((1 + m)
^2 + 4*b^2*n^2) + (2*b*n*x^(1 + m)*Cos[a + b*Log[c*x^n]]*Sin[a + b*Log[c*x^n]])/((1 + m)^2 + 4*b^2*n^2)

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 4488

Int[Cos[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*(d_.)]^(p_)*((e_.)*(x_))^(m_.), x_Symbol] :> Simp[((m + 1)*(e*x)
^(m + 1)*Cos[d*(a + b*Log[c*x^n])]^p)/(b^2*d^2*e*n^2*p^2 + e*(m + 1)^2), x] + (Dist[(b^2*d^2*n^2*p*(p - 1))/(b
^2*d^2*n^2*p^2 + (m + 1)^2), Int[(e*x)^m*Cos[d*(a + b*Log[c*x^n])]^(p - 2), x], x] + Simp[(b*d*n*p*(e*x)^(m +
1)*Sin[d*(a + b*Log[c*x^n])]*Cos[d*(a + b*Log[c*x^n])]^(p - 1))/(b^2*d^2*e*n^2*p^2 + e*(m + 1)^2), x]) /; Free
Q[{a, b, c, d, e, m, n}, x] && IGtQ[p, 1] && NeQ[b^2*d^2*n^2*p^2 + (m + 1)^2, 0]

Rubi steps

\begin {align*} \int x^m \cos ^2\left (a+b \log \left (c x^n\right )\right ) \, dx &=\frac {(1+m) x^{1+m} \cos ^2\left (a+b \log \left (c x^n\right )\right )}{(1+m)^2+4 b^2 n^2}+\frac {2 b n x^{1+m} \cos \left (a+b \log \left (c x^n\right )\right ) \sin \left (a+b \log \left (c x^n\right )\right )}{(1+m)^2+4 b^2 n^2}+\frac {\left (2 b^2 n^2\right ) \int x^m \, dx}{(1+m)^2+4 b^2 n^2}\\ &=\frac {2 b^2 n^2 x^{1+m}}{(1+m) \left ((1+m)^2+4 b^2 n^2\right )}+\frac {(1+m) x^{1+m} \cos ^2\left (a+b \log \left (c x^n\right )\right )}{(1+m)^2+4 b^2 n^2}+\frac {2 b n x^{1+m} \cos \left (a+b \log \left (c x^n\right )\right ) \sin \left (a+b \log \left (c x^n\right )\right )}{(1+m)^2+4 b^2 n^2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C]  time = 0.34, size = 91, normalized size = 0.76 \[ \frac {x^{m+1} \left (2 b (m+1) n \sin \left (2 \left (a+b \log \left (c x^n\right )\right )\right )+(m+1)^2 \cos \left (2 \left (a+b \log \left (c x^n\right )\right )\right )+4 b^2 n^2+m^2+2 m+1\right )}{2 (m+1) (-2 i b n+m+1) (2 i b n+m+1)} \]

Antiderivative was successfully verified.

[In]

Integrate[x^m*Cos[a + b*Log[c*x^n]]^2,x]

[Out]

(x^(1 + m)*(1 + 2*m + m^2 + 4*b^2*n^2 + (1 + m)^2*Cos[2*(a + b*Log[c*x^n])] + 2*b*(1 + m)*n*Sin[2*(a + b*Log[c
*x^n])]))/(2*(1 + m)*(1 + m - (2*I)*b*n)*(1 + m + (2*I)*b*n))

________________________________________________________________________________________

fricas [A]  time = 0.62, size = 105, normalized size = 0.88 \[ \frac {2 \, {\left (b m + b\right )} n x x^{m} \cos \left (b n \log \relax (x) + b \log \relax (c) + a\right ) \sin \left (b n \log \relax (x) + b \log \relax (c) + a\right ) + {\left (2 \, b^{2} n^{2} x + {\left (m^{2} + 2 \, m + 1\right )} x \cos \left (b n \log \relax (x) + b \log \relax (c) + a\right )^{2}\right )} x^{m}}{m^{3} + 4 \, {\left (b^{2} m + b^{2}\right )} n^{2} + 3 \, m^{2} + 3 \, m + 1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^m*cos(a+b*log(c*x^n))^2,x, algorithm="fricas")

[Out]

(2*(b*m + b)*n*x*x^m*cos(b*n*log(x) + b*log(c) + a)*sin(b*n*log(x) + b*log(c) + a) + (2*b^2*n^2*x + (m^2 + 2*m
 + 1)*x*cos(b*n*log(x) + b*log(c) + a)^2)*x^m)/(m^3 + 4*(b^2*m + b^2)*n^2 + 3*m^2 + 3*m + 1)

________________________________________________________________________________________

giac [F(-1)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^m*cos(a+b*log(c*x^n))^2,x, algorithm="giac")

[Out]

Timed out

________________________________________________________________________________________

maple [F]  time = 0.07, size = 0, normalized size = 0.00 \[ \int x^{m} \left (\cos ^{2}\left (a +b \ln \left (c \,x^{n}\right )\right )\right )\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^m*cos(a+b*ln(c*x^n))^2,x)

[Out]

int(x^m*cos(a+b*ln(c*x^n))^2,x)

________________________________________________________________________________________

maxima [B]  time = 0.40, size = 646, normalized size = 5.38 \[ \text {result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^m*cos(a+b*log(c*x^n))^2,x, algorithm="maxima")

[Out]

1/4*(((cos(4*b*log(c))*cos(2*b*log(c)) + sin(4*b*log(c))*sin(2*b*log(c)) + cos(2*b*log(c)))*m^2 + 2*(cos(4*b*l
og(c))*cos(2*b*log(c)) + sin(4*b*log(c))*sin(2*b*log(c)) + cos(2*b*log(c)))*m + 2*(b*cos(2*b*log(c))*sin(4*b*l
og(c)) - b*cos(4*b*log(c))*sin(2*b*log(c)) + (b*cos(2*b*log(c))*sin(4*b*log(c)) - b*cos(4*b*log(c))*sin(2*b*lo
g(c)) + b*sin(2*b*log(c)))*m + b*sin(2*b*log(c)))*n + cos(4*b*log(c))*cos(2*b*log(c)) + sin(4*b*log(c))*sin(2*
b*log(c)) + cos(2*b*log(c)))*x*x^m*cos(2*b*log(x^n) + 2*a) - ((cos(2*b*log(c))*sin(4*b*log(c)) - cos(4*b*log(c
))*sin(2*b*log(c)) + sin(2*b*log(c)))*m^2 + 2*(cos(2*b*log(c))*sin(4*b*log(c)) - cos(4*b*log(c))*sin(2*b*log(c
)) + sin(2*b*log(c)))*m - 2*(b*cos(4*b*log(c))*cos(2*b*log(c)) + b*sin(4*b*log(c))*sin(2*b*log(c)) + (b*cos(4*
b*log(c))*cos(2*b*log(c)) + b*sin(4*b*log(c))*sin(2*b*log(c)) + b*cos(2*b*log(c)))*m + b*cos(2*b*log(c)))*n +
cos(2*b*log(c))*sin(4*b*log(c)) - cos(4*b*log(c))*sin(2*b*log(c)) + sin(2*b*log(c)))*x*x^m*sin(2*b*log(x^n) +
2*a) + 2*((cos(2*b*log(c))^2 + sin(2*b*log(c))^2)*m^2 + 4*(b^2*cos(2*b*log(c))^2 + b^2*sin(2*b*log(c))^2)*n^2
+ 2*(cos(2*b*log(c))^2 + sin(2*b*log(c))^2)*m + cos(2*b*log(c))^2 + sin(2*b*log(c))^2)*x*x^m)/((cos(2*b*log(c)
)^2 + sin(2*b*log(c))^2)*m^3 + 3*(cos(2*b*log(c))^2 + sin(2*b*log(c))^2)*m^2 + 4*(b^2*cos(2*b*log(c))^2 + b^2*
sin(2*b*log(c))^2 + (b^2*cos(2*b*log(c))^2 + b^2*sin(2*b*log(c))^2)*m)*n^2 + 3*(cos(2*b*log(c))^2 + sin(2*b*lo
g(c))^2)*m + cos(2*b*log(c))^2 + sin(2*b*log(c))^2)

________________________________________________________________________________________

mupad [B]  time = 2.79, size = 82, normalized size = 0.68 \[ \frac {x\,x^m}{2\,m+2}+\frac {x\,x^m\,{\mathrm {e}}^{a\,2{}\mathrm {i}}\,{\left (c\,x^n\right )}^{b\,2{}\mathrm {i}}}{4\,m+4+b\,n\,8{}\mathrm {i}}+\frac {x\,x^m\,{\mathrm {e}}^{-a\,2{}\mathrm {i}}\,\frac {1}{{\left (c\,x^n\right )}^{b\,2{}\mathrm {i}}}\,1{}\mathrm {i}}{m\,4{}\mathrm {i}+8\,b\,n+4{}\mathrm {i}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^m*cos(a + b*log(c*x^n))^2,x)

[Out]

(x*x^m)/(2*m + 2) + (x*x^m*exp(a*2i)*(c*x^n)^(b*2i))/(4*m + b*n*8i + 4) + (x*x^m*exp(-a*2i)/(c*x^n)^(b*2i)*1i)
/(m*4i + 8*b*n + 4i)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \begin {cases} \log {\relax (x )} \cos ^{2}{\relax (a )} & \text {for}\: b = 0 \wedge m = -1 \\\int x^{m} \cos ^{2}{\left (- a + \frac {i m \log {\left (c x^{n} \right )}}{2 n} + \frac {i \log {\left (c x^{n} \right )}}{2 n} \right )}\, dx & \text {for}\: b = - \frac {i \left (m + 1\right )}{2 n} \\\int x^{m} \cos ^{2}{\left (a + \frac {i m \log {\left (c x^{n} \right )}}{2 n} + \frac {i \log {\left (c x^{n} \right )}}{2 n} \right )}\, dx & \text {for}\: b = \frac {i \left (m + 1\right )}{2 n} \\\frac {\begin {cases} \log {\relax (x )} \cos {\left (2 a \right )} & \text {for}\: b = 0 \wedge \left (b = 0 \vee n = 0\right ) \\\log {\relax (x )} \cos {\left (2 a + 2 b \log {\relax (c )} \right )} & \text {for}\: n = 0 \\\frac {\sin {\left (2 a + 2 b n \log {\relax (x )} + 2 b \log {\relax (c )} \right )}}{2 b n} & \text {otherwise} \end {cases}}{2} + \frac {\log {\relax (x )}}{2} & \text {for}\: m = -1 \\\frac {2 b^{2} n^{2} x x^{m} \sin ^{2}{\left (a + b n \log {\relax (x )} + b \log {\relax (c )} \right )}}{4 b^{2} m n^{2} + 4 b^{2} n^{2} + m^{3} + 3 m^{2} + 3 m + 1} + \frac {2 b^{2} n^{2} x x^{m} \cos ^{2}{\left (a + b n \log {\relax (x )} + b \log {\relax (c )} \right )}}{4 b^{2} m n^{2} + 4 b^{2} n^{2} + m^{3} + 3 m^{2} + 3 m + 1} + \frac {2 b m n x x^{m} \sin {\left (a + b n \log {\relax (x )} + b \log {\relax (c )} \right )} \cos {\left (a + b n \log {\relax (x )} + b \log {\relax (c )} \right )}}{4 b^{2} m n^{2} + 4 b^{2} n^{2} + m^{3} + 3 m^{2} + 3 m + 1} + \frac {2 b n x x^{m} \sin {\left (a + b n \log {\relax (x )} + b \log {\relax (c )} \right )} \cos {\left (a + b n \log {\relax (x )} + b \log {\relax (c )} \right )}}{4 b^{2} m n^{2} + 4 b^{2} n^{2} + m^{3} + 3 m^{2} + 3 m + 1} + \frac {m^{2} x x^{m} \cos ^{2}{\left (a + b n \log {\relax (x )} + b \log {\relax (c )} \right )}}{4 b^{2} m n^{2} + 4 b^{2} n^{2} + m^{3} + 3 m^{2} + 3 m + 1} + \frac {2 m x x^{m} \cos ^{2}{\left (a + b n \log {\relax (x )} + b \log {\relax (c )} \right )}}{4 b^{2} m n^{2} + 4 b^{2} n^{2} + m^{3} + 3 m^{2} + 3 m + 1} + \frac {x x^{m} \cos ^{2}{\left (a + b n \log {\relax (x )} + b \log {\relax (c )} \right )}}{4 b^{2} m n^{2} + 4 b^{2} n^{2} + m^{3} + 3 m^{2} + 3 m + 1} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**m*cos(a+b*ln(c*x**n))**2,x)

[Out]

Piecewise((log(x)*cos(a)**2, Eq(b, 0) & Eq(m, -1)), (Integral(x**m*cos(-a + I*m*log(c*x**n)/(2*n) + I*log(c*x*
*n)/(2*n))**2, x), Eq(b, -I*(m + 1)/(2*n))), (Integral(x**m*cos(a + I*m*log(c*x**n)/(2*n) + I*log(c*x**n)/(2*n
))**2, x), Eq(b, I*(m + 1)/(2*n))), (Piecewise((log(x)*cos(2*a), Eq(b, 0) & (Eq(b, 0) | Eq(n, 0))), (log(x)*co
s(2*a + 2*b*log(c)), Eq(n, 0)), (sin(2*a + 2*b*n*log(x) + 2*b*log(c))/(2*b*n), True))/2 + log(x)/2, Eq(m, -1))
, (2*b**2*n**2*x*x**m*sin(a + b*n*log(x) + b*log(c))**2/(4*b**2*m*n**2 + 4*b**2*n**2 + m**3 + 3*m**2 + 3*m + 1
) + 2*b**2*n**2*x*x**m*cos(a + b*n*log(x) + b*log(c))**2/(4*b**2*m*n**2 + 4*b**2*n**2 + m**3 + 3*m**2 + 3*m +
1) + 2*b*m*n*x*x**m*sin(a + b*n*log(x) + b*log(c))*cos(a + b*n*log(x) + b*log(c))/(4*b**2*m*n**2 + 4*b**2*n**2
 + m**3 + 3*m**2 + 3*m + 1) + 2*b*n*x*x**m*sin(a + b*n*log(x) + b*log(c))*cos(a + b*n*log(x) + b*log(c))/(4*b*
*2*m*n**2 + 4*b**2*n**2 + m**3 + 3*m**2 + 3*m + 1) + m**2*x*x**m*cos(a + b*n*log(x) + b*log(c))**2/(4*b**2*m*n
**2 + 4*b**2*n**2 + m**3 + 3*m**2 + 3*m + 1) + 2*m*x*x**m*cos(a + b*n*log(x) + b*log(c))**2/(4*b**2*m*n**2 + 4
*b**2*n**2 + m**3 + 3*m**2 + 3*m + 1) + x*x**m*cos(a + b*n*log(x) + b*log(c))**2/(4*b**2*m*n**2 + 4*b**2*n**2
+ m**3 + 3*m**2 + 3*m + 1), True))

________________________________________________________________________________________